#pragma once
// -------------------------------------------------
// ZED Kit
// -------------------------------------------------
//   File Name: build_macros.hpp
//      Author: Ziming Li
//     Created: 2022-09-17
// -------------------------------------------------
// Copyright (C) 2022 MingYang Software Technology.
// -------------------------------------------------

#ifndef ZED_BUILD_MACROS_HPP
#define ZED_BUILD_MACROS_HPP

#include "./build_macros.h"

/**
 * C++ Versions
 */

#define _Z_CPP_DEFAULT  0
#define _Z_CPP_14       1
#define _Z_CPP_17       2
#define _Z_CPP_20       3

#ifdef __cplusplus
#   if defined(_MSC_VER)
#       include <vcruntime.h>
#       if defined(_HAS_CXX20) && (_HAS_CXX20)
#           define _Z_CPP   _Z_CPP_20
#       elif defined(_HAS_CXX17) && (_HAS_CXX17)
#           define _Z_CPP   _Z_CPP_17
#       endif
#   elif defined(__clang__)
#       if (__cplusplus >= 201703L)
#           define _Z_CPP   _Z_CPP_17
#       elif (__cplusplus >= 201402L)
#           define _Z_CPP   _Z_CPP_14
#       endif
#   else
#       pragma message("TODO: Adjust _Z_CPP.")
#   endif
#endif
#ifndef _Z_CPP
#   define _Z_CPP   _Z_CPP_DEFAULT
#endif

#endif // ZED_BUILD_MACROS_HPP
